package com.rsk.aop.exception;


public class ParamLengthException extends RuntimeException {
	
	private static final long serialVersionUID = 8978184132279738481L;
	
	private final String parameterName;
    private final String parameterType;
    private final Integer minLength;
    private final Integer maxLength;

    public ParamLengthException(String parameterName, String parameterType, Integer minLength, Integer maxLength) {
        super("");
        this.parameterName = parameterName;
        this.parameterType = parameterType;
        this.minLength = minLength;
        this.maxLength = maxLength;
    }

    @Override
    public String getMessage() {
    	//return "Required " + this.parameterType + " parameter \'" + this.parameterName + "\' must be not null !";
        return "参数" + this.parameterName + "长度范围是"+this.minLength+"-"+this.maxLength;
    }

	public Integer getMinLength() {
		return minLength;
	}

	public Integer getMaxLength() {
		return maxLength;
	}

	public final String getParameterName() {
        return this.parameterName;
    }

    public final String getParameterType() {
        return this.parameterType;
    }

}
